package com.itheima.d02_runtime;

import java.io.IOException;

public class Test {
    public static void main(String[] args) throws IOException, InterruptedException {
//        1.创建运行环境对象
        Runtime runtime = Runtime.getRuntime();
        //2.获取运行环境配置
        //2.1处理器数量
        System.out.println(runtime.availableProcessors());
        //2.2内存总量
        System.out.println(runtime.totalMemory() / 1024 / 1024);
        //2.3可用的内存总量
        System.out.println(runtime.freeMemory() / 1024 / 1024);
//        2.4启动自定的程序
        Process exec = runtime.exec("\"C:\\Program Files\\Tencent\\QQNT\\QQ.exe\"");
        Thread.sleep(50000);

//     结束当前程序
        exec.destroy();



    }
}
